<h1><?php // echo CrugeTranslator::t('logon', "Login");   ?></h1>
<?php if (Yii::app()->user->hasFlash('loginflash')): ?>
    <div class="alert alert-error">
        <?php echo Yii::app()->user->getFlash('loginflash'); ?>
    </div>
<?php else: ?>
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'logon-form',
        'enableClientValidation' => false,
        'clientOptions' => array(
            'validateOnSubmit' => true,
        ),
    ));
    ?>

    <section id="signin-container" style="color: white">
        <img class="logoAnunciomin"  src="<?php echo Yii::app()->theme->baseUrl ?>/images/logo/logo.png">
        <center>
            <span >
                Iniciar Sesion<br>
                <!--<strong>Anuncios JL</strong>-->
            </span>
            <div class="fields">
                <?php echo $form->textField($model, 'username', array('placeholder' => CrugeTranslator::t('logon', 'Username'))) ?>
                <?php echo $form->error($model, 'username', array()) ?>

                <?php echo $form->passwordField($model, 'password', array('placeholder' => CrugeTranslator::t('logon', 'Password'))) ?>
                <?php echo $form->error($model, 'password') ?>
            </div
        </center>
        <!--<a href="#" title="" tabindex="3" class="forgot-password">Forgot?</a>-->
        <?php
        $this->widget('ext.bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'htmlOptions' => array(
                'class' => 'btn btn-primary btn-block',
                'tabindex' => 4
            ),
            'type' => 'inverse',
            'label' => CrugeTranslator::t('logon', "Login"),
        ));
        ?>
        <!--<button type="submit" class="btn btn-primary btn-block" tabindex="4">Sign In</button>-->
        <?php echo Yii::app()->user->ui->passwordRecoveryLink; ?>
        <?php
        if (Yii::app()->user->um->getDefaultSystem()->getn('registrationonlogin') === 1)
            echo Yii::app()->user->ui->registrationLink;
        ?>
    </section>

    <?php
    //	si el componente CrugeConnector existe lo usa:
    //
		if (Yii::app()->getComponent('crugeconnector') != null) {
        if (Yii::app()->crugeconnector->hasEnabledClients) {
            ?>
            <div class='crugeconnector'>
                <span><?php echo CrugeTranslator::t('logon', 'You also can login with'); ?>:</span>
                <ul>
                    <?php
                    $cc = Yii::app()->crugeconnector;
                    foreach ($cc->enabledClients as $key => $config) {
                        $image = CHtml::image($cc->getClientDefaultImage($key));
                        echo "<li>" . CHtml::link($image, $cc->getClientLoginUrl($key)) . "</li>";
                    }
                    ?>
                </ul>
            </div>
            <?php
        }
    }
    ?>


    <?php $this->endWidget(); ?>
<?php endif; ?>
